import './ViewCount.less';

import React, { SFC } from 'react';
import { ViewHistory } from '../../../core/domain/user/ViewHistory';

interface ViewCountProps {
    viewHistory: ViewHistory | null;
}
const ViewCount: SFC<ViewCountProps> = ({ viewHistory }) => {
    const list = viewHistory?.list.slice(0, 2) || [];
    const countText = (viewHistory?.total || 0) + '人收听了你的FM';
    return (
        <section className="view-count">
            <div className="view-count_images">
                {list.map((item: any, index: number) => (
                    <img key={index} className="view-count_head-img" src={item.headImage} alt="" />
                ))}
            </div>
            <p className="view-count_count-text">{countText}</p>
        </section>
    );
};
export default ViewCount;
